package cn.iocoder.yudao.module.crm.dal.mysql.coursematerialrlt;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.crm.controller.admin.course.vo.CourseMaterialRltPageReqVO;
import cn.iocoder.yudao.module.crm.dal.dataobject.coursematerialrlt.CourseMaterialRltDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 课程课件关系 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface CourseMaterialRltMapper extends BaseMapperX<CourseMaterialRltDO> {

    default PageResult<CourseMaterialRltDO> selectPage(CourseMaterialRltPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CourseMaterialRltDO>()
                .eqIfPresent(CourseMaterialRltDO::getCourseId, reqVO.getCourseId())
                .eqIfPresent(CourseMaterialRltDO::getCourseMaterialId, reqVO.getCourseMaterialId())
                .betweenIfPresent(CourseMaterialRltDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CourseMaterialRltDO::getId));
    }

}